package robotleMvc.frameworks.ground
{
	import _Pan3D.core.MathCore;
	import _Pan3D.display3D.Display3DContainer;
	import _Pan3D.program.Program3DManager;
	import _Pan3D.program.shaders.GroundShader;
	
	import _me.Scene_data;
	
	import flash.display3D.Context3D;
	import flash.display3D.Program3D;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	import org.robotlegs.mvcs.Mediator;
	
	import robotleMvc.frameworks.ground.model.GroundModel;
	import robotleMvc.ui.Ground.GroundView;
	
	import test.vo.GroundDisplay3DSprite;
	import test.vo.StatVO;
	// --------------MSN:lation_pan@live.cn  QQ: 3423526------------- //
	public class GroundMediator extends Mediator
	{
		[Inject]
		public var groundView:GroundView
		[Inject]
		public var groundModel:GroundModel
		public function GroundMediator()
		{
			super();
		}
		override public function onRegister():void
		{
			groundModel.display3DContainer=groundView.display3DContainer;
			groundModel.context3D=groundView.context3D;
			loadBuildConfigXml();
		}
		private function loadBuildConfigXml():void
		{
			//加载地面XML列表
			var _loaderURL:URLRequest = new URLRequest("../_File/nijia2/ground/"+"groundList.xml");
			var _scenexml:URLLoader=new URLLoader();
			_scenexml.load(_loaderURL);
			_scenexml.addEventListener(Event.COMPLETE, _loadGroundXmlOk);
			function _loadGroundXmlOk(event:Event):void
			{  
				//将XML数据传到MODEL进行解析。
				groundModel.praseGroundXmltoItem(XML(_scenexml.data));
			}
		}
	}
}